export const typeMap = {
  1: '编程任务赛—灭火挑战',
  2: '编程任务赛—物流搬运',
  3: '战术大师-棋奕争锋',
  4: '球形无人机对抗赛',
  5: '极速任务赛',
}

export const typeFieldMap = {
  fire: 1,
  logistics: 2,
  gobang: 3,
  drone: 4,
  obstacle: 5,
}

// 比赛状态
export const typeStatus = {
  group: '小组赛',
  position: '抢位赛',
  knockout: '淘汰赛',
  thirdPlace: '季军赛',
  final: '决赛',
  start: '比赛进行中',
  end: '比赛已结束',
  '': '比赛未开始',
}

export const typeFieldDataPair = [
  { value: typeFieldMap.fire, label: '灭火挑战赛' },
  { value: typeFieldMap.logistics, label: '灭火挑战赛' },
  { value: typeFieldMap.gobang, label: '灭火挑战赛' },
  { value: typeFieldMap.drone, label: '灭火挑战赛' },
  { value: typeFieldMap.obstacle, label: '灭火挑战赛' },
]

export const scoreEditColumnsConfig = {
  logistics: [
    { prop: 'id', label: 'id', width: 80 },
    { prop: 'regNo', label: '报名编号', width: 90 },
    { prop: 'studentInfo', label: '学生信息', width: 100 },
    { prop: 'groupCategory', label: '组别', width: 80 },
    { prop: 'matchSequence', label: '比赛序号', width: 90 },
    { prop: 'successTakeoff', label: '成功起飞', width: 90, type: 'integer' },
    {
      prop: 'aiObjectRecognition',
      label: '完成AI实物识别',
      width: 130,
      type: 'integer',
    },
    {
      prop: 'obstaclePass',
      label: '穿越障碍区域',
      width: 115,
      type: 'integer',
    },
    {
      prop: 'supplyDeliveryCount',
      label: '物资投放框内数量',
      width: 140,
      type: 'integer',
    },
    {
      prop: 'landZoneSuccess',
      label: '降落到降落区',
      width: 120,
      type: 'integer',
    },
    { prop: 'deductPoints', label: '扣分', width: 120, type: 'integer' },
    { prop: 'deductNotes', label: '扣分备注', width: 120, type: 'text' },
    { prop: 'totalScore', label: '总分', width: 120, type: 'integer' },
    { prop: 'useTime', label: '比赛用时', width: 120, type: 'time' },
    {
      prop: 'basePhoto',
      label: '底单照片',
      width: 120,
      type: 'image',
      serverUrl: 'http://101.200.220.56', // 服务器地址前缀
      imageWidth: '55px', // 可选：设置图片宽度
      imageHeight: '16px', // 可选：设置图片高度
    },
    { prop: 'scoreRank', label: '名次', width: 80 },
    { prop: 'playType', label: '比赛类型', width: 90 },
    { prop: 'batchNo', label: '批次号', width: 110 },
  ],
  fire: [
    { prop: 'id', label: 'id', width: 80 },
    { prop: 'regNo', label: '报名编号', width: 90 },
    { prop: 'studentInfo', label: '学生信息', width: 100 },
    { prop: 'matchSequence', label: '比赛序号', width: 90 },
    { prop: 'successTakeoff', label: '成功起飞', width: 90, type: 'integer' },
    {
      prop: 'obstaclePass',
      label: '穿越障碍区域',
      width: 120,
      type: 'integer',
    },
    { prop: 'cityPass', label: '穿越城市', width: 120, type: 'integer' },
    { prop: 'fireDetection', label: '发现火情', width: 120, type: 'integer' },
    { prop: 'waterPickup', label: '拾取水源', width: 120, type: 'integer' },
    { prop: 'fireExtinguish', label: '扑灭火情', width: 120, type: 'integer' },
    {
      prop: 'dualConnectionBonus',
      label: '双机互联奖励',
      width: 120,
      type: 'integer',
    },
    { prop: 'deductPoints', label: '扣分', width: 120, type: 'integer' },
    { prop: 'deductNotes', label: '扣分备注', width: 120, type: 'text' },
    { prop: 'totalScore', label: '总分', width: 120, type: 'integer' },
    { prop: 'useTime', label: '比赛用时', width: 120, type: 'time' },
    {
      prop: 'basePhoto',
      label: '底单照片',
      width: 120,
      type: 'image',
      serverUrl: 'http://101.200.220.56', // 服务器地址前缀
      imageWidth: '55px', // 可选：设置图片宽度
      imageHeight: '16px', // 可选：设置图片高度
    },
    { prop: 'scoreRank', label: '名次', width: 80 },
    { prop: 'playType', label: '比赛类型', width: 90 },
    { prop: 'groupCategory', label: '组别', width: 80 },
    { prop: 'batchNo', label: '批次号', width: 110 },
  ],
  obstacle: [
    { prop: 'id', label: 'id', width: 80 },
    { prop: 'regNo', label: '报名编号', width: 90 },
    { prop: 'studentInfo', label: '学生信息', width: 100 },
    { prop: 'matchSequence', label: '比赛序号', width: 90 },
    { prop: 'groupNo', label: '小组赛组号', width: 100 },
    { prop: 'positionNoText', label: '抢位赛组号', width: 100 },
    { prop: 'knockoutNo', label: '淘汰赛组号', width: 100 },
    {
      prop: 'scoreBallNumber',
      label: '击倒得分球数',
      width: 110,
      type: 'integer',
      onlyEdit: true, // 只有查看/编辑弹窗下显示，列表中不显示此字段
    },
    {
      prop: 'yellowCardNumber',
      label: '黄牌次数',
      width: 90,
      type: 'integer',
      onlyEdit: true,
    },
    {
      prop: 'redCardNumber',
      label: '红牌次数',
      width: 90,
      type: 'integer',
      onlyEdit: true,
    },
    {
      prop: 'punishBallNumber',
      label: '碰倒罚时球总数',
      width: 125,
      type: 'integer',
      onlyEdit: true,
    },
    { prop: 'points', label: '积分', width: 80 },
    { prop: 'honorValue', label: '荣誉值', width: 100, type: 'select' },
    { prop: 'useTime', label: '比赛用时', width: 120, type: 'time' },
    {
      prop: 'basePhoto',
      label: '底单照片',
      width: 120,
      type: 'image',
      serverUrl: 'http://101.200.220.56', // 服务器地址前缀
      imageWidth: '55px', // 可选：设置图片宽度
      imageHeight: '16px', // 可选：设置图片高度
    },
    { prop: 'finalScore', label: '最终得分', width: 90 },
    { prop: 'scoreRank', label: '名次', width: 60 },
    { prop: 'knockoutRound', label: '淘汰赛当前轮次', width: 130 },
    { prop: 'playType', label: '比赛类型', width: 90 },
    { prop: 'groupCategory', label: '组别', width: 80 },
    { prop: 'statusText', label: '比赛阶段', width: 90 },
    { prop: 'batchNo', label: '批次号', width: 110 },
  ],
  gobang: [
    { prop: 'id', label: 'id', width: 80 },
    { prop: 'groupNo', label: '小组赛组号', width: 100 },
    { prop: 'positionNoText', label: '抢位赛组号', width: 100 },
    { prop: 'knockoutNo', label: '淘汰赛组号', width: 100 },
    { prop: 'regNo', label: '报名编号', width: 90 },
    { prop: 'studentInfo', label: '学生信息', width: 100 },
    { prop: 'matchSequence', label: '比赛序号', width: 90 },
    { prop: 'winNumber', label: '胜场数', width: 80, type: 'integer' },
    { prop: 'fiveNumber', label: '得分', width: 100, type: 'integer' },
    { prop: 'winPoint', label: '净胜分', width: 80, type: 'negative' },
    { prop: 'foulNumber', label: '犯规次数', width: 90, type: 'integer' },
    { prop: 'sumPoint', label: '落子分净胜分', width: 90, type: 'integer' },
    // { prop: 'deductNotes', label: '扣分备注', width: 90, type: 'text' },
    { prop: 'useTime', label: '平均完赛时间', width: 120, type: 'time' },
    {
      prop: 'basePhoto',
      label: '底单照片',
      width: 120,
      type: 'image',
      serverUrl: 'http://101.200.220.56', // 服务器地址前缀
      imageWidth: '55px', // 可选：设置图片宽度
      imageHeight: '16px', // 可选：设置图片高度
    },
    { prop: 'groupSuccess', label: '小组赛是否晋级', width: 130 },
    { prop: 'competitionRound', label: '淘汰赛参赛轮次', width: 130 },
    { prop: 'finalScore', label: '最终得分', width: 100, type: 'integer' },
    { prop: 'scoreRank', label: '名次', width: 60 },
    { prop: 'knockoutRound', label: '淘汰赛当前轮次', width: 130 },
    // { prop: 'competitionRound', label: '淘汰赛参赛轮次', width: 130 },
    { prop: 'playType', label: '比赛类型', width: 90 },
    { prop: 'groupCategory', label: '组别', width: 80 },
    { prop: 'statusText', label: '比赛状态', width: 90 },
    { prop: 'batchNo', label: '批次号', width: 110 },
  ],
  drone: [
    { prop: 'id', label: 'id', width: 80 },
    { prop: 'groupNo', label: '小组赛组号', width: 100 },
    { prop: 'positionNoText', label: '抢位赛组号', width: 100 },
    { prop: 'knockoutNo', label: '淘汰赛组号', width: 100 },
    { prop: 'regNo', label: '报名编号', width: 90 },
    { prop: 'studentInfo', label: '学生信息', width: 100 },
    { prop: 'matchSequence', label: '比赛序号', width: 90 },
    { prop: 'winNumber', label: '胜场数', width: 80, type: 'integer' },
    { prop: 'winPoint', label: '净胜分', width: 80, type: 'negative' },
    { prop: 'foulNumber', label: '犯规次数', width: 90, type: 'integer' },
    // { prop: 'sumPoint', label: '总落子分', width: 90, type: 'integer' },
    // { prop: 'deductNotes', label: '扣分备注', width: 90, type: 'text' },
    { prop: 'useTime', label: '比赛用时', width: 120, type: 'time' },
    {
      prop: 'basePhoto',
      label: '底单照片',
      width: 120,
      type: 'image',
      serverUrl: 'http://101.200.220.56', // 服务器地址前缀
      imageWidth: '55px', // 可选：设置图片宽度
      imageHeight: '16px', // 可选：设置图片高度
    },
    { prop: 'groupSuccess', label: '小组赛是否晋级', width: 130 },
    { prop: 'competitionRound', label: '淘汰赛参赛轮次', width: 130 },
    { prop: 'finalScore', label: '最终得分', width: 100, type: 'integer' },
    { prop: 'scoreRank', label: '名次', width: 60 },
    { prop: 'knockoutRound', label: '淘汰赛当前轮次', width: 130 },
    // { prop: 'competitionRound', label: '淘汰赛参赛轮次', width: 130 },
    { prop: 'playType', label: '比赛类型', width: 90 },
    { prop: 'groupCategory', label: '组别', width: 80 },
    { prop: 'statusText', label: '比赛阶段', width: 90 },
    { prop: 'batchNo', label: '批次号', width: 110 },
  ],
}
// 用户不可编辑的字段列表
export const readOnlyFields = [
  'id',
  'batchNo',
  'regNo',
  'groupCategory',
  'playType',
  'matchSequence',
  'groupSuccess',
  'knockoutSuccess',
  'competitionRound',
  'groupNo',
  'positionNo',
  'positionNoText',
  'knockoutNo',
  'knockoutRound',
  'parentGroupNo',
  'status',
  'scoreRank',
  'sortID',
  'studentInfo',
  'finalScore',
  'extendInfo',
  'points',
  // 自定义字段
  'opponentId',
  'opponentStudentInfo',
  'key',
  'statusText',
  'sort',
  'useTimeMillisecond',
]
